package com.wangc.report.service.impl;

import com.wangc.report.dao.TragetTableMapper;
import com.wangc.report.entity.TragetTableEntity;
import com.wangc.report.service.TragetTableService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Service实现类
 *
 * @author wangc
 * @email 1620415297@qq.com
 * @date 2020-10-20 14:14:15
 */
@Service("tragetTableService")
public class TragetTableServiceImpl implements TragetTableService {
    private static final Logger LOG = LoggerFactory.getLogger(TragetTableServiceImpl.class);
    @Resource
    private TragetTableMapper tragetTableMapper;

    @Override
    public TragetTableEntity queryObject(Long id) {
        return tragetTableMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<TragetTableEntity> queryList(Map<String, Object> map) {
        LOG.debug(map.toString());
        return tragetTableMapper.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tragetTableMapper.queryTotal(map);
    }

    @Override
    public int save(TragetTableEntity tragetTable) {
        return tragetTableMapper.insertSelective(tragetTable);
    }

    @Override
    public int update(TragetTableEntity tragetTable) {
        return tragetTableMapper.updateByPrimaryKeySelective(tragetTable);
    }

    @Override
    public int delete(Long id) {
        return tragetTableMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteBatch(Long[] ids) {
        return tragetTableMapper.deleteBatch(ids);
    }
}
